#ifndef PLAYLISTVIEW_H
#define PLAYLISTVIEW_H

#include <QWidget>
#include <QTreeWidgetItem>
#include <QAbstractListModel>
#include "EZTallyArray.h"

class RadioModel;
class MyPlayListModel;

namespace Ui {
class PlayListView;
}

class PlayListView : public QWidget
{
    Q_OBJECT

public:
    explicit PlayListView(QWidget *parent = 0);
    ~PlayListView();

    enum itemType
    {
        itemType_Unknow,

        itemType_Dirs, //文件夹大栏目
        itemType_DownLoadPath,
        itemType_Dir, //单个目录

        itemType_PlayLists,
        itemType_MyPlayList,

        itemType_Radios, //电台大栏目
        itemType_RadioAll, //
        itemType_RadioHistory,
        itemType_RadioCollect
    };

    virtual void	contextMenuEvent(QContextMenuEvent * event);
private:
    Ui::PlayListView *ui;

    void initPlayLlistView();
    void refreshDirItems();
    void refreshMyPlayList();
    EZTally::EZTallyArray<MyPlayListModel*> *_myPlaylists;

    void showDirsMenu(const QPoint & pos);
    void showPlayListsMenu(const QPoint &pos);
    void showMyPlayListMenu(const QPoint &pos,int index);
signals:
    void sig_changeCenterWidget(QWidget *widget);
public slots:
//    void slot_itemChanged(QTreeWidgetItem * item, int column);
    void slot_currentItemChanged(QTreeWidgetItem * current, QTreeWidgetItem * previous);
    void slot_customContextMenuRequested(const QPoint & pos);


};

#endif // PLAYLISTVIEW_H
